package com.wc.alorithm_luogu.P1422;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/19 12:06
 * @description https://www.luogu.com.cn/problem/P1422
 * 小玉家的电费（有陷阱）
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // 所消耗的电量
        double e = sc.nextDouble();

        double price = 0;

        // 电量标准
        double[] standard = new double[3];
        standard[0] = 150;
        standard[1] = 400;

        // 标准收费
        double[] prices = new double[3];
        prices[0] = 0.4463;
        prices[1] = 0.4663;
        prices[2] = 0.5663;

        // 第一个标准
        if (e <= standard[0]) {
            price += e * prices[0];
        } else {
            price += standard[0] * prices[0];
            // 第二个标准
            if (e <= standard[1]) {
                price += (e - standard[0]) * prices[1];
            } else {
                price += (standard[1] - standard[0]) * prices[1];
            }
        }

        if (e > standard[1]) {
            price += (e - standard[1]) * prices[2];
        }

//        price = (int)(price * 10 + 0.5)/10.0;
        System.out.printf("%.1f", price);
    }
}
